import java.util.Date;
import static java.lang.Math.*;
//import static java.lang.System.*;
class Student {
    private String name;

    public void setClassroom(String classroom) {
        this.classroom = classroom;
    }

    private int age;

    public String getClassroom() {
        return classroom;
    }

    public static String classroom; //上课的教室
    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return this.name;
    }

    public void eat() {
        System.out.println(this.name + "正在吃饭！");
    }


}
public class Test {
    public static void main(String[] args) {
        Student student1 = new Student("张三", 10);
        //student1.classroom = "3-601"; //不属于对象，就不能通过对象的引用来访问，但是不是报错，是警告，不合理
        Student.classroom = "3-601"; //这样的方式更合理
        Student student2 = new Student("李四", 9);
        Student student3 = new Student("王二麻子", 11);

        System.out.println(" ");
    }
    public static void main2(String[] args) {
        double d1 = 12.5;
        double d2 = 12;

        pow(d2,d1);

        System.out.println();
//        Date date = new Date();  //Alt+回车 ->快速导包

    }
    public static void main1(String[] args) {
        Student student = new Student("张三", 10);
        //student.name = "dafa";   实现封装后就无法直接拿到这个name字段了
        student.setName("李四");
        System.out.println(student.getName());
        student.eat();
    }
}
